{extend name="public/base"}

{block name="title"}就行天下-实名认证{/block}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/home/css/set.css" />
{js href="__STATIC__/home/css/jquery.jcrop.min.css" /}
{/block}


{block name="main"}
<div class="pageControl twoCodeMain">
    <div class="main-top"></div>
    <div class="msui_nav msui_navTop">
        <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
        <h1 class="msui_navTop-title">实名认证</h1>
        <a href="" class="msui_navTop-right msui_navTop-cnav"><i class="micon-cnav"></i></a>
    </div>
    <div class="weui-cell bg-f8">
        <p class="weui-cell__hd cl-9999">身份信息</p>
    </div>
    <form action="?" method="post">
        <div class="weui-cell bg-ff">
            <div class="weui-cell__hd">
                <label class="weui-label cl-3333">姓名</label>
            </div>
            <div class="weui-cell__bd">
                <input type="text" class="weui-input" placeholder="请输入您身份证上的姓名" name="proposer" value="{$data.proposer|default=''}" />
            </div>
        </div>
        <div class="weui-cell bg-ff">
            <div class="weui-cell__hd">
                <label class="weui-label cl-3333">身份证号</label>
            </div>
            <div class="weui-cell__bd">
                <input type="text" class="weui-input" placeholder="请输入您的身份证号" name="card_no" value="{$data.card_no|default=''}"  />
            </div>
        </div>
        <div class="weui-cell">
            <p class="weui-cell__hd cl-3333">身份照片</p>
        </div>
        <div class="shop_card_img bg-fff">
            <a href="javascript:;" class="shop_card_img_a pl">
                <img src="{$data.id_card_front|default='__STATIC__/home/images/weirenzheng_05.png'}" alt="" class="id_card_front"/>
                <p class="text-center">身份证正面照片</p>
                <input class="uploaderInput weui-uploader__input" type="file" accept="image/*" data-field="id_card_front" data-quantity="pic" data-width="332" data-height="209"/>
                <input type="hidden" name="id_card_front" value="{$data.id_card_front|default=''}">
            </a>
            <a href="javascript:;" class="shop_card_img_a pl">
                <img src="{$data.id_card_verso|default='__STATIC__/home/images/weirenzheng_09.png'}" alt="" class="id_card_verso" />
                <p class="text-center">身份证反面照片</p>
                <input class="uploaderInput weui-uploader__input" type="file" accept="image/*" data-field="id_card_verso" data-quantity="pic" data-width="332" data-height="209"/>
                <input type="hidden" name="id_card_verso" value="{$data.id_card_verso|default=''}">
            </a>
            <a href="javascript:;" class="shop_card_img_a pl">
                <img src="{$data.id_card_in_hand|default='__STATIC__/home/images/weirenzhen_03.png'}" alt="" class="id_card_in_hand"/>
                <p class="text-center">手持身份证正面照片</p>
                <input class="uploaderInput weui-uploader__input" type="file" accept="image/*" data-field="id_card_in_hand" data-quantity="pic" data-width="332" data-height="209"/>
                <input type="hidden" name="id_card_in_hand" value="{$data.id_card_in_hand|default=''}">
            </a>
        </div>
        <input type="hidden" name="id" value="{$data.id|default=0}" />
    </form>
    <div class="p05 mtop10">
        <a href="javascript:;" class="bg-c40 cl-f weui-btn send_form">提交</a>
    </div>
</div>
{/block}

{block name="javascript"}
{js href="__STATIC__/home/js/jquery.jcrop.min.js" /}
{js href="__STATIC__/home/js/jquery.jcrop.upload.js" /}
{js href="__STATIC__/home/js/exif.js" /}
<script>
    var _status = '{$data.status}';
    SCOPE.upload_img_type = 7;
    $(function () {
        if (_status == 1) {
            $("#autonym-no").popup();
        }

        $(".send_form").click(function () {
            $.showLoading('正在提交。。');
            var _form = $('form');
            $.ajax({
                type : _form.attr('method'),
                url : _form.attr('action'),
                data : _form.serialize(),
                dataType : 'json',
                success : function (msg) {
                    if (msg.code == 200) {
                        window.location.href = "{:url('index')}";
                    } else{
                        $.hideLoading();
                        $.toptip(msg.msg);
                    }
                }
            });
        });
    });
</script>
{/block}